﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OA.Service.Model
{
    /// <summary>
    /// 请求基类
    /// </summary>
    [System.Xml.Serialization.XmlRoot(XmlRootName)]
    public class BaseReqeust<T> where T : BaseResponse
    {
        /// <summary>
        /// 请求头名称
        /// </summary>
        public const string XmlRootName = "Request";

        /// <summary>
        /// 请求头信息
        /// </summary>
        public Data.Head Head { get; set; }

        public BaseReqeust()
        {
            Head = new Data.Head();
        }

        public BaseReqeust(string actionName)
        {
            Head = new Data.Head()
            {
                ActionName = actionName
            };
        }

    }

    /// <summary>
    /// 返回基类
    /// </summary>
    [System.Xml.Serialization.XmlRoot(XmlRootName)]
    public class BaseResponse
    {
        /// <summary>
        /// 返回头名称
        /// </summary>
        public const string XmlRootName = "Response";

        /// <summary>
        /// 返回代号，0成功，大于0失败
        /// </summary>
        public int Code { get; set; }

        /// <summary>
        /// 返回消息
        /// </summary>
        public string Message { get; set; }
    }
}